package com.hackordie.operations.creates;

import com.hackordie.commons.HackOrDieResult;
import com.hackordie.commons.game.player.UserComponent;
import com.hackordie.exceptions.HackOrDieException;
import com.hackordie.operations.AHackOrDieOperationUserComponents;

public class CreateUserComponent extends AHackOrDieOperationUserComponents{

    private UserComponent userComponent;
    
    public CreateUserComponent(UserComponent userComponent) {
        super();
        this.userComponent = userComponent;
    }

    @Override
    protected boolean checkParameters() {
        // TODO Auto-generated method stub
        return true;
    }

    @Override
    protected HackOrDieResult executeOperation() throws HackOrDieException {
        result.setCorrect(userComponentDao.create(userComponent));
        result.setObject(userComponent);
        return result;
    }
}
